<?php
/**
 * Created by PhpStorm.
 * User: User
 * Date: 2017/9/18
 * Time: 18:43
 */
class person{
public $name;
public $age;
public $sex;

public function say(){
echo '我养的是'.$this->name
.',我养的品种是'.$this->sex
.',猪龄是'.$this->age;
}
}
$my=new person();
$my->name='锦强';
$my->sex='大学生';
$my->age='1';
$my->say();